package com.jiamao.goplay.ui.discover.vm;

import android.os.Bundle;

import com.jiamao.goplay.ui.user.OthersUserInfoFragment;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableField;
import androidx.databinding.ObservableList;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.base.MultiItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

public class FindItemImageViewVM extends MultiItemViewModel {


    public ObservableField<String> imgUrl = new ObservableField<>("");
    public ObservableField<Integer> isDefaul = new ObservableField<>(0);
    private String uid;
    public FindItemImageViewVM(@NonNull BaseViewModel viewModel,String  avatarList,String uid) {
        super(viewModel);
        if (avatarList!=null){
            imgUrl.set(avatarList);
        }
        this.uid = uid;

    }

    public FindItemImageViewVM(@NonNull BaseViewModel viewModel) {
        super(viewModel);




    }

    //条目的点击事件
    public BindingCommand itemClick = new BindingCommand(new BindingAction() {
        @Override
        public void call() {

            //  RxToast.showToastShort( sz.get());
            //  sz.get()

            //   ToastUtils.showShort("我是头布局");
            if (uid==null  || uid.equals("")){
                return;
            }
            Bundle bd = new Bundle();
            bd.putString("uid",uid);
            viewModel.startContainerActivity(OthersUserInfoFragment.class.getCanonicalName(),bd);
        }
    });

}
